"""
Token 视图模型
"""

from pydantic import (
    BaseModel,
    Field,
)


class JWTPayloadViewModel(BaseModel):
    """ JWT 荷载 视图模型 """

    subject: str = Field(
        ...,
        title="主题",
        description="Token 签发的来源",
    )

    issue_time: str = Field(
        ...,
        title="签发时间",
        description="格式：YYYY-MM-DD HH:mm:ss",
        min_length=19,
        max_length=19,
    )

    expire_time: str = Field(
        ...,
        title="过期时间",
        description="格式：YYYY-MM-DD HH:mm:ss",
        min_length=19,
        max_length=19,
    )

    user_code: str = Field(
        ...,
        title="用户编号",
        description="Token MongoDB 用户 Collection 的 code 字段",
    )
